<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.itheima.test.User" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: 15289
  Date: 2023/11/16
  Time: 11:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户表格制作</title>
</head>
<body>
    <%
        List list=new ArrayList();
        list.add(new User("lili",23,new Date()));
        list.add(new User("lisi",21,new Date()));
        list.add(new User("libai",26,new Date()));

        request.setAttribute("list",list);
    %>

<table border="1" width="500px" align="center">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>生日</th>
    </tr>

    <c:forEach items="${list}" var="user" varStatus="s">
        <tr>
            <td>${s.count}</td>
            <td>${user.name}</td>
            <td>${user.age}</td>
            <td>${user.date}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
